import Root from "./root";
import ErrorPage from "../pages/err-page";
import Contact from '../pages/contact';
import UseMount from '../pages/lifecycle/useMount';
import UseToggle from '../pages/state/useToggle';
import UseCreation from '../pages/advanced/useCreation';
import UseRequest from '../pages/useRequest/index';
import {
  createBrowserRouter,
} from "react-router-dom";

const router = createBrowserRouter([
  {
    path: "/",
    element: <Root />,
    errorElement: <ErrorPage />,
    children: [
      {
        path: "useRequest",
        element: <UseRequest />
      },
      {
        path: "lifecycle",
        element: <UseMount />
      },
      {
        path: "state",
        element: <UseToggle />
      },
      {
        path: "advanced",
        element: <UseCreation />
      },
      {
        path: "contacts/:contactId",
        element: <Contact />
      }
    ]
  },
]);

export default router;